/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hecatone;

/**
 *
 * @author fredericpaquette
 * 
 * 
 * Army objects created are temporary and created during the tick for various operations
 * 
 * The values represented here are based on the current modifiers which are impacted by the current terrain, weather
 * etc.
 */

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class Squad {
private static final Logger logger = Logger.getLogger(Squad.class); 

public int ID;
public int TROUP_TYPE;
public int NUMBER;
public int CONSTITUTION;
public int ATTACK;
public String TROUP_NAME;
private float T_MODIFIER = 100;
public int CLIMATE;
    
    public Squad (int TROUP_TYPE, String TROUP_NAME, int NUMBER, int CONSTITUTION, int ATTACK)
    {
        this.TROUP_TYPE = TROUP_TYPE;
        this.TROUP_NAME = TROUP_NAME;
        this.CONSTITUTION = CONSTITUTION;
        this.ATTACK = ATTACK;
        this.NUMBER = NUMBER;
        
    }
    
    /*
     * This method return the squad attack power which is based on the base attack and the terrain modifier
     * If the terrain modifier is let to default, then the returned value is the base attack.
     */
    public int getSquadAttack()
    {
        int attack = (int) (ATTACK * T_MODIFIER);
        
        logger.debug("In getSquadAttack, attack value is "+ ATTACK);
        return attack;
    }
    
    public int getSquadConstitution()
    {
        int defense = (int) (CONSTITUTION * T_MODIFIER);
        logger.debug("In getSquadConstitution, constitution value is: " + defense);
        return defense;
    }
    
    
    /*
     * This value is extracted from the table TERRAIN_TYPE and divided by 100 to modify the troup strenght.
     */
    public void setTerrainModifier(int terrain)
    {
        T_MODIFIER = terrain / 100;
    }
    
}
